package com.jwgf.common;

import android.app.Application;
import android.content.Context;

import androidx.multidex.MultiDex;

import com.github.moduth.blockcanary.BlockCanary;


public class AppContext extends Application {
	private static AppContext instance;
//	private RefWatcher sRefWatcher;
	public static boolean isDebug = false;
	public static boolean isReform = false;

	public static final String version = "VCRO_SK_20210721_1632";

	public static AppContext getInstance(){
		return instance;
	}
	
	@Override
	public void onCreate() {
		super.onCreate();
//		if (LeakCanary.isInAnalyzerProcess(this)) {
//			// This process is dedicated to Perflib for heap analysis.
//			// You should not init your app in this process.
//			return;
//		}
//		sRefWatcher = LeakCanary.install(this);
		BlockCanary.install(this, new AppBlockCanaryContext()).start();
		instance = this;
		if (!isDebug) {
			CrashHandler crashHandler = CrashHandler.getInstance();
			crashHandler.init(getApplicationContext());
		}

	}

	@Override
	protected void attachBaseContext(Context base) {
		super.attachBaseContext(base);
		MultiDex.install(base);
	}

	//	public RefWatcher getRefWatcher() {
//		return sRefWatcher;
//	}

}
